package com.iot08.common.constant;

/**
 * @version 1.0
 * @Description: redis缓存key值管理枚举类
 * @time: 2020/11/6 9:07
 * @author: Rock
 */
public enum CacheEnum {

    //登录accesstoken (30天失效)
    UA("UA:", 3600 * 24 * 30),

    //验证码 (10分钟有效期)
    VCODE("VCODE:", 60*10),

    //临时凭证, 用于修改更换手机号和注销账号: (5分钟有效期)
    T_TOKEN("T_TOKEN:", 60*5),

    //1.9 * 60 * 60
    WACHAT_ACCESS_TOKEN("&wechat_access_token", 6840),

    //1.5 * 60 * 60
    WACHAT_TICKET("&wechat_ticket", 5400),


    FREQUENT("frequent:", 2),

    VIDEO("video:", 20 * 60),
    GROUP_VIDEO("group_video:", 20 * 60), // 群视频和群语音


    //支付密码验证码
    payInPwdVCode("payInPwdVCode:", 300),



    GROUP_VIDEO_TIME("group_video_time:", 300),

    LOG_UPDATE("LogUpdate:", 24 * 60 * 60),

    DATA_FLOWQ("dataflowQ:", 60),

    INQUIRE("inquire:", 60),

    //标记Key 及失效时间
    PPMF("PPMF:", 30),

    LAST_LBS_DATA("&lastLBSData", 7 * 24 * 60 * 60),

    READ_IMEI_MSG_TIME("&ReadImeiMsgTime", 0),

    READ_SYS_MSG_TIME("&ReadSysMsgTime", 0),

    READ_USER_ATTENTION_MSG_TIME("&ReadUserATMsgTime", 0),

    HEALTHQ("healthQ_%s:%s:%s", 60),

    UpBodyTemperature("upBodyTemperature:%s:%s", 60),

    UpHeartRate("upHeartRate:%s:%s", 60),

    //kafka消费指令标记，根据此标记将指令推送到不同的topic中
    K_TOPIC_IDENT("kTopicIdent:", 0),

    // APP 主动定位的标记字段
    RequestLocationIdent("requestLocation:", 60);

    private String key;

    private int expire;

    CacheEnum() {
    }

    CacheEnum(String key, int expire) {
        this.key = key;
        this.expire = expire;
    }

    CacheEnum(String key) {
        this.key = key;
    }

    public String getKey() {
        return key;
    }

    public int getExpire() {
        return expire;
    }
}
